// Text协议类 用\n符号进行分割
// Created by taojiaheng on 2020/6/5.
//

#ifndef WEBSOCKETSERVER_TEXT_H
#define WEBSOCKETSERVER_TEXT_H
#include "Protocol.h"

class Text : public Protocol{
public:
    Text();
    ~Text();
    // 实现夫类中的虚函数
    // 协议是否需握手
    bool is_handshake = false;
    // 检测分包位置
    int input(BUFF * buff, Connection* client) override;
    // 协议解码
    BUFF * decode(BUFF * _buff, Connection * client) override;
    // 协议编码
    BUFF * encode(BUFF * _buff, Connection * client) override;
    // 处理协议握手函数
    int handshake(BUFF * _buff, Connection * client) override;
};


#endif //WEBSOCKETSERVER_TEXT_H
